package test;

import java.awt.Rectangle;

public class SmallBullet {
	public int x;
	public int y;
	public static final int WIDTH=10;
	public static final int HEIGHT=10;
	public SmallBullet(){}
	public SmallBullet(int x,int y){
		this.x=x;
		this.y=y;
	}
	public void move(){
		this.y+=5;
	}
	@SuppressWarnings("static-access")
	public boolean hit(MyPlane mp){
		boolean b=false;
		Rectangle sbRect=new Rectangle(this.x,this.y,this.WIDTH,this.HEIGHT);
		Rectangle mpRect=new Rectangle(mp.x,mp.y,mp.WIDTH,mp.HEIGHT);
		b=mpRect.intersects(sbRect);
		return b;
	}
	public boolean hit1(PlaneTwo pt){
		boolean b=false;
		Rectangle sbRect=new Rectangle(this.x,this.y,this.WIDTH,this.HEIGHT);
		Rectangle mpRect=new Rectangle(pt.x,pt.y,pt.WIDTH,pt.HEIGHT);
		b=mpRect.intersects(sbRect);
		return b;
	}
}
